# Contributor: TBK <alpine@jjtc.eu>
# Maintainer: TBK <alpine@jjtc.eu>
pkgname=prometheus-rethinkdb-exporter
pkgver=1.0.1
pkgrel=18
pkgdesc="Prometheus exporter for RethinkDB"
url="https://github.com/rethinkdb/prometheus-exporter"
license="Apache-2.0"
arch="all !riscv64" # FTBFS
options="!check" # no test suite
makedepends="go"
subpackages="$pkgname-openrc"
source="$pkgname-$pkgver.tar.gz::https://github.com/rethinkdb/prometheus-exporter/archive/v$pkgver.tar.gz
	prometheus-rethinkdb-exporter.initd
	"
builddir="$srcdir/prometheus-exporter-$pkgver"

export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}"
export GOTMPDIR="${GOTMPDIR:-"$srcdir"}"
export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}"

build() {
	make
}

package() {
	install -Dm755 rethinkdb-exporter "$pkgdir"/usr/bin/$pkgname

	install -m755 -D "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname
}

sha512sums="b3a184f2df30c3f8b23e958fd304c438f9612d55a587927ce22621b9e6982323f850969089de6fb5a90499f7ff0d3b1d63e98620020fd7103ea175452ec33731  prometheus-rethinkdb-exporter-1.0.1.tar.gz
478eb2d38c97f30f32eae814221a477fb094bdf19e48748b731a67cd9359f4009ab4e47369b02b8744c52be209c941d80c564c9c92d714ad15592e1193f19aa0  prometheus-rethinkdb-exporter.initd"
